package FWK.core;

import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JMenuItem;

import FWK.util.FwkMessageManager;

public class FwkMenuItem extends JMenuItem {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6950884769813030848L;

	public FwkMenuItem(ActionListener listener, int key, String image,
			String tooltip, String propertyMessage) {
		
		String message = FwkMessageManager.getInstance().getProperty(
				propertyMessage);

		this.addActionListener(listener);
		this.setMnemonic(key);
		this.setIcon(new ImageIcon(image));
		this.setText(message);
		
		if (tooltip == null || tooltip.trim().equals("")) {
			this.setToolTipText(message);
		} else {
			this.setToolTipText(tooltip);
		}
	}
}
